package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 质量管理-废品报废日志表
 * </p>
 *
 * @author mt
 * @since 2022-03-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_scrap_substrate_log")
public class ScrapSubstrateLog extends Model<ScrapSubstrateLog> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
      @TableId("id")
    private Long id;

    /**
     * 基板ID
     */
    @TableField("substrate_id")
    private String substrateId;

    /**
     * 来源： 00A / 00C
     */
    @TableField("source")
    private String source;

    /**
     * 废品等级(这个字段舍弃，从T_EQUIPMENT_SCRAPS_GRADE 关联表中取字段)
     */
    @TableField("scrap_grade")
    private String scrapGrade;

    /**
     * 登记人，关联T_WORKER 表
     */
    @TableField("register_person")
    private Long registerPerson;

    /**
     * 登记时间
     */
    @TableField("register_time")
    private LocalDateTime registerTime;

    /**
     * 报废原因 关联T_SCRAP_INFORMATION 表 id
     */
    @TableField("scrap_reason_id")
    private Long scrapReasonId;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 创建人
     */
    @TableField("creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField("creator_name")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField("updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField("updater_name")
    private String updaterName;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号
     */
    @TableField("version")
    @Version
    private Integer version;

    /**
     * 关联T_EQUIPMENT（产生废片的 设备id）
     */
    @TableField("equipment_id")
    private Long equipmentId;

    /**
     * 基板录入类型：1=自动录入、2=手动录入
     */
    @TableField("entry_type")
    private Integer entryType;

    /**
     * 工单ID (关联工单表 T_WORK_ORDER)
     */
    @TableField("work_order_id")
    private Long workOrderId;

    /**
     * 登记地点：默认00A
     * */
    @TableField("place_of_regis")
    private String placeOfRegis;


    public static final String ID = "id";

    public static final String SUBSTRATE_ID = "substrate_id";

    public static final String SOURCE = "source";

    public static final String SCRAP_GRADE = "scrap_grade";

    public static final String REGISTER_PERSON = "register_person";

    public static final String REGISTER_TIME = "register_time";

    public static final String SCRAP_REASON_ID = "scrap_reason_id";

    public static final String REMARK = "remark";

    public static final String VALID = "valid";

    public static final String CREATOR_ID = "creator_id";

    public static final String CREATOR_NAME = "creator_name";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATER_NAME = "updater_name";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String EQUIPMENT_ID = "equipment_id";

    public static final String ENTRY_TYPE = "entry_type";

    public static final String WORK_ORDER_ID = "work_order_id";

    public static final String PLACE_OF_REGIS = "place_of_regis";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
